#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<cctype>
using namespace std;

class Solution {
public:
    bool isPalindrome(string s) {
        if (s.empty())
        {
            return true;
        }
        int right = s.size() - 1;
        int left = 0;

        while (left < right)
        {
            while (left < right && !isalnum(s[left])) left++;
            while (left < right && !isalnum(s[right])) right--;

            if (tolower(s[left]) != tolower(s[right]))
            {
                return false;
            }

            left++;
            right--;
        }

        return true;
    }
};

int main()
{
    Solution solution;
    string input;

    getline(cin, input);
    if (solution.isPalindrome(input))
    {
        cout << "true" << endl;
    }
    else
    {
        cout << "false" << endl;
    }
	return 0;
}